<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>indexHead</title>
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet" href="{$Think.const.CSS_URL}bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="{$Think.const.CSS_URL}indexHead.css" type="text/css">
    <script src="{$Think.const.JS_URL}jquery-2.2.3.min.js"></script>
    <script src="{$Think.const.JS_URL}bootstrap.js"></script>
</head>
<body>
    <div class = "header_top"><!--最顶层模块header_top-->
        <div class="container">
            <div class = "top-left">
                <ul class="list-inline">
                    <li><a href="__MODULE__/User/contact" target="_parent">联系我们</a></li>|
                    <li><a href="__MODULE__/User/user" target="_parent">查看订单</a></li>
                </ul>
            </div>
            <div class = "top-right">
                <ul class="list-inline">
                    <li>你好：</li>
                    <li><a href="__MODULE__/User/login" target="_parent" id = "name_url"><span id ="u_name">{$Think.session.u_name}</span></a></li>
                </ul>
            </div>
        </div>
    </div>

    <div class="header">
        <div class = "container">
            <div class = "header_left">
                <a href="__MODULE__/Index/index" target="_parent"><img src="{$Think.const.img_url}logo.png" ></a>
                <span>Honey Store</span>
            </div>
            <div class="header_right">
                <a href ="__MODULE__/Goods/checkOut?u_id={$Think.session.u_id}" target="_parent" id ="cart">
                    <i class="icon-shopping-cart">&nbsp;&nbsp;购物车(<span id = "cart-amount">{$Think.session.amount}</span>)</i>
                </a>
            </div>
        </div>
    </div>

</body>
</html>
<script>
    $(window).load(function(){
        if($('#u_name').text() == ""){
            $('#u_name').text("请登录");
        }
        else{
            $('#name_url').attr("href","__MODULE__/User/user");
        }
        if($('#cart-amount').text() == ""){
            $('#cart-amount').text("0");
        }
    });
</script>